package com.gzhu.knowledgeAdmin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.gzhu.knowledgeAdmin.dao.XtcsMapper;
import com.gzhu.knowledgeAdmin.entity.PageBean;
import com.gzhu.knowledgeAdmin.entity.TXtcsT;
import com.gzhu.knowledgeAdmin.service.XtcxService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class XtcsServiceImpl extends ServiceImpl<XtcsMapper, TXtcsT> implements XtcxService {
    @Resource
    private XtcsMapper xtcsMapper;

    @Override
    public PageBean<TXtcsT> selectAll(Integer pageNum, Integer pageSize, @Param(value = "fgsid") String fgsid) {

        PageBean<TXtcsT> pb = new PageBean();
        PageHelper.startPage(pageNum,pageSize);
        List<TXtcsT>as=xtcsMapper.selectAll(fgsid);
        Page<TXtcsT> page= (Page<TXtcsT>) as;

        pb.setTotal(page.getTotal());
        pb.setItems(page.getResult());



        return pb;
    }
}
